# cmake的最小版本
cmake_minimum_required(VERSION 3.18)
# 项目名称
project(HW1_OPENCV)
# opencv库目录
include_directories(/usr/local/include/opencv4)
find_package(OpenCV REQUIRED)
# 指定为C++11 版本
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
    # debug编译
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -O0")
    message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
elseif(CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
    # release编译
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -O3")
    message("Release mode:${CMAKE_C_FLAGS_RELEASE}")
else()
    # 默认进行release编译
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -O3")
    message("else:${CMAKE_C_FLAGS_RELEASE}")
endif()
add_subdirectory(src bin)